home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / v10n20.arc / CHKCPU.ARC / CHECKCPU.ASM < prev    next >
Assembly Source File  |  1991-10-28  |  2KB  |  101 lines

  1.         title   CHECKCPU.ASM - Report CPU type
  2.         page    55,132
  3.  
  4. ; CHECKCPU.ASM - Report CPU Type
  5. ; Copyright (c) 1991 Ray Duncan
  6.  
  7. stdout  equ     1                       ; standard output handle
  8.  
  9. cr      equ     0dh                     ; ASCII carriage return
  10. lf      equ     0ah                     ; ASCII line feed
  11.  
  12. _DATA   segment word public 'DATA'
  13.  
  14. msg1    db      cr,lf,'The CPU type is '
  15. msg1_len equ $-msg1
  16.  
  17. msg2    db      'unknown.',cr,lf
  18. msg2_len equ $-msg2
  19.  
  20. msg86   db      '8086 or 8088.',cr,lf
  21. msg86_len equ $-msg86
  22.  
  23. msg286  db      '80286.',cr,lf
  24. msg286_len equ $-msg286
  25.  
  26. msg386  db      '80386SX or 80386DX.',cr,lf
  27. msg386_len equ $-msg386
  28.  
  29. msg486  db      '80486SX or 80486DX.',cr,lf
  30. msg486_len equ $-msg486
  31.  
  32. _DATA   ends
  33.  
  34. _TEXT   segment word public 'CODE'
  35.  
  36.         extrn   cputype:near
  37.  
  38.         assume  cs:_TEXT,ds:_DATA,ss:_STK
  39.  
  40. chkcpu  proc    far
  41.  
  42.         mov     ax,_DATA                ; make our data addressable 
  43.         mov     ds,ax
  44.         mov     es,ax
  45.  
  46.         mov     ah,40h
  47.         mov     bx,stdout
  48.         mov     cx,msg1_len
  49.         mov     dx,offset _DATA:msg1
  50.         int     21h
  51.  
  52.         call    cputype
  53.  
  54.         cmp     ax,86h
  55.         jne     chk1
  56.         mov     cx,msg86_len
  57.         mov     dx,offset _DATA:msg86
  58.         jmp     chk9
  59.  
  60. chk1:   cmp     ax,286h
  61.         jne     chk2
  62.         mov     cx,msg286_len
  63.         mov     dx,offset _DATA:msg286
  64.         jmp     chk9
  65.  
  66. chk2:   cmp     ax,386h
  67.         jne     chk3
  68.         mov     cx,msg386_len
  69.         mov     dx,offset _DATA:msg386
  70.         jmp     chk9
  71.  
  72. chk3:   cmp     ax,486h
  73.         jne     chk4
  74.         mov     cx,msg486_len
  75.         mov     dx,offset _DATA:msg486
  76.         jmp     chk9
  77.  
  78. chk4:   mov     cx,msg2_len
  79.         mov     dx,offset _DATA:msg2
  80.  
  81.  
  82. chk9:   mov     ah,40h
  83.         mov     bx,stdout
  84.         int     21h
  85.  
  86.         mov     ax,4c00h
  87.         int     21h
  88.  
  89. chkcpu  endp
  90.  
  91. _TEXT   ends
  92.  
  93. _STK    segment para stack 'STACK'
  94.  
  95.         db      128 dup (?)
  96.  
  97. _STK    ends
  98.  
  99.         end     chkcpu
  100.  
  101.